Core.Scheduler.AsyncFunction = function(fn, interval, once) {
	this.fn = fn;
	this.once = once;
	Core.Scheduler.AsyncFunction.superclass.constructor.call(this, interval);
};

Env.extend(Core.Scheduler.AsyncFunction, Core.Scheduler.Async, {
	
	/**
	 * Executes the async function.
	 */
	execute: function() {
		if(this.running) { 
			this.fn();
			this._reschedule();
		}
		if(this.once) { this.running = false; }
	}
});